package com.session01;

public class Food {
    private String foodName;       //食物名称
    private double foodPrice;      //食物
    private String foodkind;      //猫粮，狗粮

    public Food(String foodName, double foodPrice, String foodkind) {
        this.foodName = foodName;
        this.setFoodPrice(foodPrice);
        this.foodkind = foodkind;
    }

    public String getFoodName() {
        return foodName;
    }

    public void setFoodName(String foodName) {
        this.foodName = foodName;
    }

    public double getFoodPrice() {
        return foodPrice;
    }

    public void setFoodPrice(double foodPrice) {
        if (foodPrice >= 0) {
            this.foodPrice = foodPrice;
        }

    }

    public String getFoodkind() {
        return foodkind;
    }

    public void setFoodkind(String foodkind) {
        this.foodkind = foodkind;
    }
}
